package com.ruoyi.hospital.service.coupon.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.coupon.CouponRecordMapper;
import com.ruoyi.hospital.domain.coupon.CouponRecord;
import com.ruoyi.hospital.service.coupon.ICouponRecordService;

/**
 * 领券记录Service业务层处理
 * 
 * @author wendao
 * @date 2024-10-08
 */
@Service
public class CouponRecordServiceImpl implements ICouponRecordService 
{
    @Autowired
    private CouponRecordMapper couponRecordMapper;

    /**
     * 查询领券记录
     * 
     * @param id 领券记录主键
     * @return 领券记录
     */
    @Override
    public CouponRecord selectCouponRecordById(Integer id)
    {
        return couponRecordMapper.selectCouponRecordById(id);
    }

    /**
     * 查询领券记录列表
     * 
     * @param couponRecord 领券记录
     * @return 领券记录
     */
    @Override
    public List<CouponRecord> selectCouponRecordList(CouponRecord couponRecord)
    {
        return couponRecordMapper.selectCouponRecordList(couponRecord);
    }

    /**
     * 新增领券记录
     * 
     * @param couponRecord 领券记录
     * @return 结果
     */
    @Override
    public int insertCouponRecord(CouponRecord couponRecord)
    {
        couponRecord.setCreateTime(DateUtils.getNowTimeSecond());
        return couponRecordMapper.insertCouponRecord(couponRecord);
    }

    /**
     * 修改领券记录
     * 
     * @param couponRecord 领券记录
     * @return 结果
     */
    @Override
    public int updateCouponRecord(CouponRecord couponRecord)
    {
        couponRecord.setUpdateTime(DateUtils.getNowTimeSecond());
        return couponRecordMapper.updateCouponRecord(couponRecord);
    }

    /**
     * 批量删除领券记录
     * 
     * @param ids 需要删除的领券记录主键
     * @return 结果
     */
    @Override
    public int deleteCouponRecordByIds(Integer[] ids)
    {
        return couponRecordMapper.deleteCouponRecordByIds(ids);
    }

    /**
     * 删除领券记录信息
     * 
     * @param id 领券记录主键
     * @return 结果
     */
    @Override
    public int deleteCouponRecordById(Integer id)
    {
        return couponRecordMapper.deleteCouponRecordById(id);
    }
}
